package com.wxtt.android.activity;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.fast.dev.frame.ui.ContentView;
import com.fast.dev.frame.ui.V;
import com.fast.dev.frame.utils.AndroidInfoUtils;
import com.fast.dev.frame.utils.ToolUtils;
import com.wxtt.android.R;
import com.wxtt.android.common.CommonActivity;

/**
 * 说明：版本说明
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2016/3/15 14:03
 * <p/>
 * 版本：verson 1.0
 */
@ContentView(R.layout.activity_about)
public class AboutActivity extends CommonActivity{

    private LinearLayout ll_url;
    private TextView tv_version;

    @Override
    protected boolean showToolbar() {
        return true;
    }

    @Override
    public void onInit(Bundle bundle) {
        super.onInit(bundle);
        ll_url = bind(R.id.ll_url);
        tv_version = bind(R.id.tv_version);
        ll_url.setOnClickListener(this);
        V.setText(tv_version,R.string.about_version, AndroidInfoUtils.getAppVersionName(this));
    }

    @Override
    public void clickView(View v) {
        super.clickView(v);
        switch (v.getId()){
            case R.id.ll_url:
                ToolUtils.openBrowser(this,getString(R.string.app_url));
            break;
        }
    }

    @Override
    public int setToolbarTitle() {
        return R.string.about;
    }

    @Override
    protected void onCustomToolbar(View view, Toolbar toolbar) {
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


}
